<!DOCTYPE html>
<html>
<head>
	<style>
		html {
			width : 960px;
		}
		body{
			max-width : 100%;
			width : 100%;
			padding : 0;
			margin : 0;
		}
		.content{
			width : 100%;
			height : 100%;
			background : url('../assets/images/bg_sertifikat.jpg') no-repeat;
			background-size : 100% 100%;
			padding : 75px 75px 75px 75px;
			page-break-after: always;
		}
		.container{
			width : 810px;
			height : 550px;
			display: block;
			position: relative;
		}
		table{
			text-align:center;
		}
		h1{
			padding:0;
			margin:0 0 5px 0;
		}
		h2{
			padding:0;
			margin:0 0 10px 0;
		}
		h3{
			padding:0;
			margin:15px 0 15px 0;
		}
	</style>
</head>
<body>
	<?php
	$inc_det=0;
	foreach($records AS $sub){
	?>
	<div class="content">
		<div class="container">
			<table width="810px" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td colspan='2'><h1>PIALA PENGHARGAAN ADI SISWA FIESTA</h1></td>
				</tr>
				<tr>
					<td colspan='2'><h2>SUARA MUDA INDONESIA SURABAYA BERPRESTASI</h2></td>
				</tr>
				<tr>
					<td colspan='2'><hr/></td>
				</tr>
				<tr>
					<td colspan='2'>Kepala Dinas Pendidikan Kota Surabaya dalam rangka Kegiatan Adi Siswa Fiesta <?php echo date('Y'); ?>.<br/>
					Dengan ini memberikan penghargaan kepada :
					</td>
				</tr>
				<tr>
					<td colspan='2'><h3><?php echo $sub->siswa_nama; ?></h3><br/><h3><?php echo $sub->sekolah_nama; ?></h3></td>
				</tr>
				<tr>
					<td rowspan='4' align='right'>&nbsp;</td>
					<td width='500px'>Surabaya, <?php echo help_id_date(date('d-m-Y'), TRUE)?></td>
				</tr>
				<tr>
					<td>Kepala Dinas Pendidikan<br/>Kota Surabaya</td>
				</tr>
				<tr>
					<td height='80'>&nbsp;</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
				</tr>
			</table>
		</div>
	</div>
	<div class="content">
		<div class="container">
			<table width="810px" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td>No.</td>
					<td>Judul Lomba</td>
					<td>Level</td>
					<td>Juara</td>
					<td>Skor</td>
				</tr>
	<?php
		$inc = 1;
		foreach($records_det AS $sub_det){
			if($sub->det_prestasi_siswa_id == $sub_det->det_prestasi_siswa_id){
				echo "<tr>";
				echo "<td>". $inc ."</td>";
				echo "<td>". $sub_det->lomba_judul ."</td>";
				echo "<td>". $sub_det->level_nama ."</td>";
				echo "<td>". $sub_det->juara_nama ."</td>";
				echo "<td>". $sub_det->prestasi_skor ."</td>";
				echo "</tr>";
				$inc++;
				unset($records_det[$inc_det]);
			}else{
				$inc = 0;
				break;
			}
		}
	?>
			</table>
		</div>
	</div>
	<?php
	}
	?>
</body>
</html>